package com.platform.config;

import org.apache.velocity.tools.ToolContext;
import org.apache.velocity.tools.ToolManager;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.context.annotation.Bean;


//@Configuration
public class Toolbox {
    private Logger logger = LoggerFactory.getLogger(Toolbox.class);

    @Bean
    public ToolContext toolContext() {
        ToolManager toolManager = new ToolManager();
        toolManager.configure(Toolbox.class.getClassLoader().getResource("/").getPath() + "WEB-INF/velocity-toolbox.xml");
        ToolContext toolContext = toolManager.createContext();
        logger.info("ToolBoxContext is init");
        return toolContext;
    }
}